﻿//这个文件中定义了相关位操作的宏

/*
下面的宏用来从数字中取出某些特定位
*/
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define _bitm(v, a, b, size) (((v) << ((size) - (b)-1)) >> ((size) - (b)-1 + (a)))
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: Binary literals are available in C# 7:
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define bit1(v, a) (((v) >> (a)) & 0b1)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define bitm64(v, a, b) _bitm(v, a, b, 64)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define bitm(v, a, b) _bitm(v, a, b, 32)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define bitm16(v, a, b) _bitm(v, a, b, 16)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define bitm8(v, a, b) _bitm(v, a, b, 8)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define bitm4(v, a, b) _bitm(v, a, b, 4)

/*
下面的宏用来处理符号扩展
符号扩展： 将一个不足32位的数字连同符号位一起扩展到32位
*/
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define val_bits(val) ((uint32)sizeof(val) << 3)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define sign_extend(val, val_bits) (((int32)((val) << (32 - (val_bits)))) >> (32 - (val_bits)))
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define sign_extend_e(val) (((int32)((val) << (32 - val_bits(val)))) >> (32 - val_bits(val)))

/*
下面的命令用来简化指令读取
*/
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define inst_bm(from, to) bitm(inst, from, to)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define inst_b1(pos) bit1(inst, pos)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define inst_b4(from) inst_bm(from, from + 3)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define inst_b8(from) inst_bm(from, from + 7)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define inst_b16(from) inst_bm(from, from + 15)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define inst_b24(from) inst_bm(from, from + 23)
